<?php
/**
 * 热门关键词统计文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	keywords
 */
if (is_object($objWebInit)) {
	if(!isset($objkeywords)){
		include_once(__WEB_ROOT."/keywords/class/keywords.class.php");
		include_once(__WEB_ROOT."/keywords/config/var.inc.php");
		$objkeywords =& new keywords();
		$objkeywords->setDBG($arrGPdoDB);
		if(is_object($objWebInit->db)) $objkeywords->db = $objWebInit->db;
		else $objkeywords->db();
	}
	
	$strFileName=__WEB_ROOT.'/cache/tempkeywords2.php';
	$arrHotKeywords = array();
	$isWriteFile=true;
	$intCacheTime=0;//缓存秒数
	
	$objCache = new cache($strFileName,$intCacheTime);
	if($objCache->cache_is_active()) {
		include_once($strFileName);
	}else{
		//取出内容
		$arrHotKeywords = $objkeywords->getInfoList(" WHERE submit_date>'".date("Y-m-d",strtotime("-7 days"))."'","  ORDER BY clicktimes DESC", 0, 7,'*',null,false);
		$str='<?php'."\n".'$arrHotKeywords = '.var_export($arrHotKeywords,true).';'."\n".'?>';
		$objCache->write_file($str);
	}

	$arrMOutput["smarty_assign"]['arrHotKeywords'] = $arrHotKeywords;
}
?>